﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace DataLayer
{
    [KnownType(typeof(Seat))]
    [DataContract(IsReference=true)]
    public class PartBooking
    {
        private int _ageGroup;
        private List<Seat> _seats;

        public PartBooking(int ageGroup, List<Seat> seats)
        {
            SetValues(ageGroup, seats);
        }

        public PartBooking(int ageGroup)
        {
            SetValues(ageGroup, null);
        }

        public PartBooking()
        {
            SetValues(0, null);
        }

        private void SetValues(int ageGroup, List<Seat> seats) {
            _ageGroup = ageGroup;
            _seats = seats;
        }

        [DataMember]
        public int AgeGroup
        {
            get { return _ageGroup; }
            set { _ageGroup = value; }
        }

        [DataMember]
        public List<Seat> Seats
        {
            get { return _seats; }
            set { _seats = value; }
        }
    }
}
